package com.chenglu.android.cart.mvp.model;




import com.chenglu.android.cart.bean.CartBean;
import com.chenglu.android.cart.bean.CartUpdateBean;
import com.chenglu.android.cart.mvp.contract.CartContract;
import com.chenglu.android.common.net.RetrofitClient;
import com.chenglu.android.common.net.RetrofitClientCL;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;

/**
 * @author: lyj
 * @Created by Copyright 2023/3/27 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @description model
 */
public class CartModel implements CartContract.CartModel {


    @Override
    public Observable<CartBean> getCart(String token) {
        return RetrofitClientCL.getInstance().getApi().getCart(token);
    }

    @Override
    public Observable<CartUpdateBean> getCartUpadet(String token, RequestBody requestBody) {
        return RetrofitClientCL.getInstance().getApi().getCartUpdate(token,requestBody);
    }

    @Override
    public Observable<CartUpdateBean> getCartRemove(String token, String ids) {
        return RetrofitClientCL.getInstance().getApi().getCartRemove(token,ids);
    }
}
